{% if user.is_authenticated %}
 
    {% csrf_token %}
    <ul class="clearfix">
        <li><span class="navbar-brand">Hello {{ user.username }}!</span></li>
        <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
    </ul>

 

{% else %}

<ul class="clearfix">
    <input type="button" value="sfasdfasdf"/>
    <li><a href="{% url 'login' %}">Log in</a></li>
    <li><a href="{% url 'login' %}">Sign on</a></li>
</ul>

{% endif %}
